<div class="am-u-sm-12 widget main-w">
	{if $notPopup}
	<ol class="am-breadcrumb">
		<li><a href="{:url('/admin/index')}">首页</a></li>
		<li><a href="{:url('/admin/car/index')}">业务管理</a></li>
		<li class="am-active">司机管理</li>
	</ol>
	{/if}
	<div class="am-u-sm-12 cl-p">
		<form class="am-form tpl-form-border-form tpl-form-border-br" action="" method="get">
			<div class="am-u-sm-2">
				<select name="work_state" data-am-selected="{btnWidth: '100%',btnSize: 'sm'}">
					<option value="0">全部</option>
					<option {$Think.get.work_state==1?selected:''} value="1">执行任务中</option>
					<option {$Think.get.work_state==2?selected:''} value="2">有预约订单</option>
					<option {$Think.get.work_state==3?selected:''} value="3">听单中</option>
					<option {$Think.get.work_state==4?selected:''} value="4">下班</option>
				</select>
			</div>
			{if $notPopup}
			<div class="am-u-sm-2">
				<input type="hidden" class="company_id" name="company_id" value="{$Think.get.company_id}" />
				<input type="text" class="am-form-field tpl-form-no-bg  company_name"  value="{$item.company_name}" placeholder="点击选择公司/单位" readonly="">
			</div>
			{/if}
			<div class="am-u-sm-2">
				<input type="text" class="tpl-form-input" name="name" placeholder="司机姓名" value="{$Think.get.name}">
			</div>
			<div class="am-u-sm-2">
				<input type="text" class="tpl-form-input" name="phone" placeholder="司机电话" value="{$Think.get.phone}">
			</div>
			<div class="am-u-sm-2">
				<input type="text" class="tpl-form-input" name="c-number" placeholder="车牌号" value="{:input('param.c-number')}">
			</div>
			<div class="am-u-sm-2">
				<button type="submit" class="am-btn am-btn-sm am-btn-primary am-radius">查询<i class="am-icon-search"></i></button>
			</div>

		</form>
	</div>
	
	<div style="padding: 10px;" class="am-u-sm-12">
		<form class="am-form tpl-form-border-form tpl-form-border-br cl-p cl-m" action="outexcel" method="get">
		{if $notPopup}
		
		{if $Think.get.filter}
		
		<div class="am-btn-group am-u-sm-12 am-btn-group-xs cl-p">
			<a href="{:url('index')}" class="am-btn am-btn-default">
				</span> 查看可用司机</a>
			<button class="am-btn am-btn-default am-fr" style="float: right;">导出数据</button>
		</div>
		{else/}
		<div class="am-btn-group am-u-sm-12 am-btn-group-xs cl-p">
			<a href="{:url('add')}" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</a>
			<button type="button" class="am-btn am-btn-default delete-multiple" data-method='deleteMultiple'><span class="am-icon-trash-o"></span> 删除</button>
			<!--<button type="button" class="am-btn am-btn-default">短信发送</button>-->
			<a href="{:url('index')}?filter=delete" class="am-btn am-btn-default">查看已删除司机</a>
			<button class="am-btn am-btn-default am-fr" style="float: right;">导出数据</button>
		</div>
		{/if}
		{/if}
		</form>
		<table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped am-text-truncate tpl-table-black" id="driver">
			<thead>
				<tr>
					{if $op == 'search'}
					<th>操作</th>
					{else/}
				<th><input type="checkbox" data-checkall='1' class="check-all"/></th>
					{/if}
					<th>姓名</th>
					<th>状态</th>
					{if $op == 'search'} {else/}
					<th>状态操作</th>
					{/if}
					<th>电话</th>
					<th>所属公司</th>
					<th>关联车辆</th>
					{if $op == 'search'} {else/}
					<!--<th>关联操作</th>-->
					{/if}
					<th>驾龄</th>
					<th>余额</th>
					<th>星级</th>
					<th>司机状态</th>
					{if $op == 'search'} {else/}
					<th>操作</th>
					{/if}
				</tr>
			</thead>
			<tbody>
				{foreach $list as $key => $item}
				<tr data-id="{$item.driver_id}">
					{if $op == 'search'}
					<td>
						<div class="tpl-table-black-operation">
							<a href="javascript:;" class="choose" data-id="{$item.driver_id}" data-name="{$item.name}">
								<i class="am-icon-pencil"></i> 选中
							</a>
						</div>
					</td>
					{else/}
					<th><input type="checkbox" class="check-list" /></th>
					{/if}
					<td>
						<a href="{:url('detail',['driver_id'=>$item.driver_id])}">{$item.name}</a>
					</td>
					<td class="am-text-{$item.state==9?'danger':'success'}">{$item.state==9?'已禁用':'已启用'}</td>
					{if $op == 'search'} {else/}
					<td>
						<div class="tpl-table-black-operation">
							{if $item.state == 9}
							<a href="javascript:;" class="startusing" data-method="startusing">
								<i class="am-icon-pencil"></i> 启用
							</a>
							{else/}
							<a href="javascript:;" class="tpl-table-black-operation-del forbidden" data-method="forbidden">
								<i class="am-icon-trash"></i> 禁用
							</a>
							{/if}
						</div>
					</td>
					{/if}
					<td>{$item.phone}</td>
					<td>{$item.company_name}</td>
					<td>
						<div class="am-u-sm-12 cl-p">
							<div class="tpl-table-black-operation">
								<a href="{:url('relevance',['driver_id'=>$item.driver_id])}">
									<i class="am-icon-pencil"></i> 查看
								</a>
							</div>
						</div>
					</td>
					{if $op == 'search'} {else/}
					<!--<td>
						<div class="tpl-table-black-operation">
							<a class="tpl-table-black-operation-del unbind">
								<i class="am-icon-trash"></i> 解除
							</a>
							<a class="bind">
								<i class="am-icon-pencil"></i> 关联
							</a>

						</div>
					</td>-->
					{/if}
					<td>{$item.driving_age}</td>
					<td>{$item.balance?:0}</td>
					<td>{$item.star?:'暂无评价'}</td>
					<td>
						{if $item.work_state==1} 执行任务中 {elseif $item.work_state==2/} 有预约订单 {elseif $item.work_state==3/} 听单中 {else/} 下班  {/if}
					</td>
					{if $op == 'search'} {else/}
					<td>
						<div class="tpl-table-black-operation">

							<a href="{:url('edit',['driver_id'=>$item.driver_id])}{if $Think.get.page}?page={$Think.get.page}{else/}?page=1{/if}">
								<i class="am-icon-pencil"></i> 编辑
							</a>
							<a class="look_order" data-id="{$item.driver_id}">
								<i class="am-icon-pencil"></i> 查看订单
							</a>
							<a class="look_where" data-id="{$item.driver_id}">
								<i class="am-icon-pencil"></i> 当前位置
							</a>
							<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
								<i class="am-icon-trash"></i> 删除
							</a>
							<!--<a href="javascript:;" class="showmap" data-method="showmap">
								<i class="am-icon-map"></i> 当前位置
							</a>-->
						</div>
					</td>
					{/if}
				</tr>
				{/foreach}
				<!-- more data -->
			</tbody>
		</table>
		<input type="hidden" class="driver_id" /> {if $op == 'search'} {else/}
		
		{/if}
		<div class="am-u-lg-12 am-cf">

			<div class="am-fr">
				{$pager}
			</div>
		</div>
	</div>

</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>